package com.servo.enums;

import lombok.Getter;

/**
 * 状态码定义约束，共6位，前3位代表服务，后3位代表接口
 *
 * @author Bingo
 */
public enum BizCodeEnum {

    /**
     * 通用操作码
     */
    OPS_REPEAT(110001, "重复操作"),

    /**
     * 验证码
     */
    CODE_TO_ERROR(240001, "接收号码不合规"),
    CODE_LIMITED(240002, "验证码发送过快"),
    CODE_ERROR(240003, "验证码错误"),
    CODE_CAPTCHA_ERROR(240101, "图形验证码错误"),

    /**
     * 账号
     */
    ACCOUNT_REPEAT(250001, "账号已经存在"),
    ACCOUNT_UNREGISTER(250002, "账号不存在"),
    ACCOUNT_PWD_ERROR(250003, "账号或者密码错误"),
    ACCOUNT_UNLOGIN(250004, "账号未登录"),
    ACCOUNT_INCONSISTENT_PWD(250005, "密码不一致"),
    ACCOUNT_REGISTER_ERROR(250006, "账号注册失败"),
    ACCOUNT_WX_LOGIN_ERROR(250007, "微信登录失败"),
    ACCOUNT_LOGIN_ERROR(250008, "账号登录失败"),
    ACCOUNT_OLD_PWD_WRONG(250009, "原密码错误"),

    /**
     * 收货地址
     */
    ADDRESS_ADD_FAIL(290001, "新增收货地址失败"),
    ADDRESS_DEL_FAIL(290002, "删除收货地址失败"),
    ADDRESS_NO_EXITS(290003, "收货地址不存在"),

    /**
     * 检测报告
     */
    DETECT_PARAMETER_ERROR(300003, "参数异常"),
    DETECT_REPEAT_IMAGES_ERROR(300004,"图像库已存在该图片"),

    /**
     * PC_管理员
     */
    ADMIN_PARAMETER_ERROR(400003, "参数异常"),
    ADMIN_DELETED_USER_ERROR(400003, "账户删除失败"),
    ADMIN_DELETED_ROLE_USER_ERROR(400004, "角色删除失败"),

    /**
     * 文件相关
     */
    FILE_UPLOAD_USER_IMG_FAIL(600101, "用户头像文件上传失败");

    @Getter
    private final Integer code;

    @Getter
    private final String message;

    BizCodeEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }
}